import request from '@/config/axios'

// 语音指令配置 VO
export interface AudioCommandVO {
  id: number // 命令主键
  cmdTitle: string // 命令标题
  keyword: string // 关键词, 多个使用英文逗号分隔
  sensorType: number // 传感器类型
  operateType: number // 操作类型
  step: number // 操作幅度
  enable: boolean // 是否可见
  remark: string // 备注
}

// 语音指令配置 API
export const AudioCommandApi = {
  // 查询语音指令配置分页
  getAudioCommandPage: async (params: any) => {
    return await request.get({ url: `/resource/audio-command/page`, params })
  },

  // 查询语音指令配置详情
  getAudioCommand: async (id: number) => {
    return await request.get({ url: `/resource/audio-command/get?id=` + id })
  },

  // 新增语音指令配置
  createAudioCommand: async (data: AudioCommandVO) => {
    return await request.post({ url: `/resource/audio-command/create`, data })
  },

  // 修改语音指令配置
  updateAudioCommand: async (data: AudioCommandVO) => {
    return await request.put({ url: `/resource/audio-command/update`, data })
  },

  // 删除语音指令配置
  deleteAudioCommand: async (id: number) => {
    return await request.delete({ url: `/resource/audio-command/delete?id=` + id })
  },

  // 导出语音指令配置 Excel
  exportAudioCommand: async (params) => {
    return await request.download({ url: `/resource/audio-command/export-excel`, params })
  }
}